Skip to content

o/snapstate: prevent removal of seed-refresh snaps when seed-refresh is enabled - #16952

Merged
andrewphelpsj merged 1 commit into
canonical:masterfrom
andrewphelpsj:seed-refresh-prevent-remove
Jun 1, 2026
Merged

o/snapstate: prevent removal of seed-refresh snaps when seed-refresh is enabled#16952
andrewphelpsj merged 1 commit into
canonical:masterfrom
andrewphelpsj:seed-refresh-prevent-remove

Conversation

@andrewphelpsj

@andrewphelpsj andrewphelpsj commented Apr 21, 2026

Copy link
Copy Markdown
Member

Since seed-refresh doesn't support adding/losing snaps from the seed, we need to ensure that the running system always has the snaps that are a part of the seed.

@github-actions github-actions Bot added the Needs Documentation -auto- Label automatically added which indicates the change needs documentation label Apr 21, 2026
@github-actions

github-actions Bot commented Apr 21, 2026

Copy link
Copy Markdown

Mon Jun 1 14:13:32 UTC 2026
The following results are from: https://github.com/canonical/snapd/actions/runs/26640531379

Failures:

Executing:

  • openstack:opensuse-tumbleweed-selinux-64:tests/main/security-logging
  • openstack:opensuse-16.0-64:tests/main/security-logging
  • openstack:opensuse-tumbleweed-64:tests/main/security-logging
  • garden:ubuntu-core-18-64:tests/core/auto-refresh-backoff-after-reboot:kernel

Skipped tests from snapd-testing-skip

If you wish to have any of the below tests run in your PR, in your PR description, add 'unskip:' followed by a copy-and-pasted list (without variants) of the below tests you wish to run (unskip plus test list must be valid yaml)

  • garden:ubuntu-25.10-64:tests/main/apparmor-prompting-support
  • openstack-arm:ubuntu-24.04-arm-64:tests/main/i18n
  • openstack-arm:ubuntu-24.04-arm-64:tests/main/snapctl-is-ready
  • openstack-arm:ubuntu-24.04-arm-64:tests/main/snapctl-no-wait
  • openstack-arm:ubuntu-core-24-arm-64:tests/main/i18n
  • openstack-arm:ubuntu-core-24-arm-64:tests/main/snapctl-is-ready
  • openstack-arm:ubuntu-core-24-arm-64:tests/main/snapctl-no-wait
  • openstack:amazon-linux-2-64:tests/main/snapctl-no-wait
  • openstack:amazon-linux-2023-64:tests/main/snapctl-no-wait
  • openstack:arch-linux-64:tests/main/snapctl-no-wait
  • openstack:centos-9-64:tests/main/snapctl-no-wait
  • openstack:debian-12-64:tests/main/snapctl-no-wait
  • openstack:debian-sid-64:tests/main/interfaces-network-status-classic
  • openstack:debian-sid-64:tests/main/snapctl-no-wait
  • openstack:fedora-44-64:tests/main/snapctl-is-ready
  • openstack:fedora-44-64:tests/main/snapctl-no-wait
  • openstack:opensuse-16.0-64:tests/main/snapctl-no-wait
  • openstack:opensuse-tumbleweed-64:tests/main/snapctl-no-wait
  • openstack:opensuse-tumbleweed-selinux-64:tests/main/snapctl-no-wait
  • openstack:ubuntu-16.04-64:tests/main/snapctl-is-ready
  • openstack:ubuntu-16.04-64:tests/main/snapctl-no-wait
  • openstack:ubuntu-18.04-64:tests/main/snapctl-is-ready
  • openstack:ubuntu-18.04-64:tests/main/snapctl-no-wait
  • openstack:ubuntu-20.04-64:tests/main/snapctl-is-ready
  • openstack:ubuntu-20.04-64:tests/main/snapctl-no-wait
  • openstack:ubuntu-22.04-64:tests/main/snapctl-is-ready
  • openstack:ubuntu-22.04-64:tests/main/snapctl-no-wait
  • openstack:ubuntu-24.04-64:tests/main/i18n
  • openstack:ubuntu-24.04-64:tests/main/snapctl-is-ready
  • openstack:ubuntu-24.04-64:tests/main/snapctl-no-wait
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-flag-restart
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_fd_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_path_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_write_same_path_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_conflict
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_defaults
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_safer
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:read_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:read_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:special_characters
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:timespan_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:timespan_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_allow_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_deny_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-prompt-restoration
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-snapd-startup
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-support
  • openstack:ubuntu-25.10-64:tests/main/interfaces-requests-activates-handlers
  • openstack:ubuntu-25.10-64:tests/main/snapctl-is-ready
  • openstack:ubuntu-25.10-64:tests/main/snapctl-no-wait
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-flag-restart
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:audio_record_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_fd_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_path_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_write_write_same_path_single_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:download_file_conflict
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:download_file_defaults
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:download_file_safer
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:read_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:read_single_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:special_characters
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:timespan_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:timespan_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_allow_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_deny_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_single_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-prompt-restoration
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-snapd-startup
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-support
  • openstack:ubuntu-26.04-64:tests/main/i18n
  • openstack:ubuntu-26.04-64:tests/main/interfaces-requests-activates-handlers
  • openstack:ubuntu-26.04-64:tests/main/snapctl-is-ready
  • openstack:ubuntu-26.04-64:tests/main/snapctl-no-wait
  • openstack:ubuntu-core-18-64:tests/main/snapctl-is-ready
  • openstack:ubuntu-core-18-64:tests/main/snapctl-no-wait
  • openstack:ubuntu-core-20-64:tests/main/snapctl-is-ready
  • openstack:ubuntu-core-20-64:tests/main/snapctl-no-wait
  • openstack:ubuntu-core-22-64:tests/main/snapctl-is-ready
  • openstack:ubuntu-core-22-64:tests/main/snapctl-no-wait
  • openstack:ubuntu-core-24-64:tests/main/snapctl-is-ready
  • openstack:ubuntu-core-24-64:tests/main/snapctl-no-wait
  • openstack:ubuntu-core-26-64:tests/main/snapctl-is-ready
  • openstack:ubuntu-core-26-64:tests/main/snapctl-no-wait

@andrewphelpsj
andrewphelpsj force-pushed the seed-refresh-prevent-remove branch 2 times, most recently from 97e87f7 to 30bea64 Compare April 23, 2026 14:01
@codecov

codecov Bot commented Apr 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.90476% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.99%. Comparing base (bd44356) to head (b126617).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
overlord/devicestate/devicestate.go 72.72% 2 Missing and 1 partial ⚠️
overlord/snapstate/snapstate.go 62.50% 2 Missing and 1 partial ⚠️
overlord/snapstate/seed.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #16952      +/-   ##
==========================================
- Coverage   78.99%   78.99%   -0.01%     
==========================================
  Files        1378     1376       -2     
  Lines      192017   192101      +84     
  Branches     2464     2464              
==========================================
+ Hits       151681   151743      +62     
- Misses      31185    31207      +22     
  Partials     9151     9151              
Flag Coverage Δ
unittests 78.99% <61.90%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andrewphelpsj
andrewphelpsj force-pushed the seed-refresh-prevent-remove branch 2 times, most recently from 3bfd63f to 4a527b7 Compare April 29, 2026 16:41
@github-actions github-actions Bot removed the Needs Documentation -auto- Label automatically added which indicates the change needs documentation label Apr 29, 2026
@andrewphelpsj
andrewphelpsj force-pushed the seed-refresh-prevent-remove branch from 4a527b7 to 7f2902d Compare May 6, 2026 18:53
@andrewphelpsj
andrewphelpsj force-pushed the seed-refresh-prevent-remove branch 2 times, most recently from 9864a78 to 842a4f9 Compare May 28, 2026 15:28
//
// TODO:SEEDREFRESH: remove this hook once seed-refresh supports seeds
// gaining/losing snaps
var CheckSeedRefreshRemove = func(st *state.State, si *snap.Info, dctx DeviceContext) error {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this does feel lame, but at least it is temporary?

@pedronis pedronis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks reasonable

@bboozzoo bboozzoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andrewphelpsj
andrewphelpsj force-pushed the seed-refresh-prevent-remove branch from 842a4f9 to b126617 Compare May 29, 2026 13:38
@andrewphelpsj andrewphelpsj added the Auto rerun spread Auto reruns spread up to 4 times in non-draft PRs w/ >=1 approval and <20 fails in any fund. system label May 29, 2026
@andrewphelpsj
andrewphelpsj merged commit 619cc92 into canonical:master Jun 1, 2026
381 of 415 checks passed
@andrewphelpsj
andrewphelpsj deleted the seed-refresh-prevent-remove branch June 1, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto rerun spread Auto reruns spread up to 4 times in non-draft PRs w/ >=1 approval and <20 fails in any fund. system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants